<?php $this->renderPartial('//common/header'); ?>
<div id="main">
<div class="container">
	<div class="box-list-preview web-supermarket">
		<?php if(!empty($themes)){ ?>
			<input class="id_shop" type="hidden" value="<?php echo (isset($_GET['shop_id'])) ? $_GET['shop_id'] : ''; ?>"/>
			<ul>
				<?php foreach($themes as $theme){ ?>
					<li>
						<h4><?php echo $theme->name; ?></h4>
						<div class="wrap-image">
							<img src="<?php echo getImage($theme->image, 223, 165) ?>" alt="img" width="223" height="165">
							<i class="icon-ib icon-view"></i>
						</div>
						Chọn mẫu này <input type="radio" value="<?php echo $theme->id; ?>" class="chooseTheme" name="chooseTheme"/>
					</li>
				<?php } ?>
			</ul>
			<input type="button" class="create" value="Khởi tạo website" />
		<?php }else echo translate("Không tìm thấy themes"); ?>
	</div>
</div>
</div>
<div id="push"> </div>
</div>
<script>
	$(document).ready(function(){
		$(".create").click(function(){
			var id_theme = $("input[name=chooseTheme]:checked").val();
			var id_shop = $(".id_shop").val();
			
			if(id_shop != null){
				$.ajax({
					url: "<?php echo PIUrl::createUrl('/shop/createWeb');?>"+"?id_shop="+id_shop+"&id_theme"+id_theme,
					success: function(result){
						alert(result);
					},
				});
			}
		});
	});
</script>
<?php $this->renderPartial('//common/footer'); ?>